package autoActivity.tools;

import java.awt.image.BufferedImage;

import org.json.JSONObject;

/**
 * 验证码识别工具类
 * @author xz8090
 *
 */
public class CodeIdentification {

	public static String getCodeFromBufferedImage(BufferedImage img) {
		try {
			JSONObject obj=new JSONObject(ChaoJiYing.bytes2Object(ChaoJiYing.imageToBytes(img,"png")));
		    String codeResult=obj.getString("pic_str").toUpperCase();
		    return codeResult;
			
		}catch(Exception e) {
		}
		return "";
	}
}
